package md.mru.core.domains;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "folder_states", schema = "c##mru_optimized")
public class FolderState implements Serializable {

    private static final long serialVersionUID = 4045504106140364167L;

    @Id
    private long id;

    @Column(name = "name", length = 30)
    private String name;

    @Column(name = "icon")
    private String icon;

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "folder_states_order_groups",
            joinColumns = @JoinColumn(name = "folder_state_id"),
            inverseJoinColumns = @JoinColumn(name = "order_type_group_id")
    )
    private List<OrderTypeGroup> orderTypeGroups;

    @Column(name = "block_position")
    private boolean blockPosition;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<OrderTypeGroup> getOrderTypeGroups() {
        return orderTypeGroups;
    }

    public void setOrderTypeGroups(List<OrderTypeGroup> orderTypeGroups) {
        this.orderTypeGroups = orderTypeGroups;
    }

    public boolean isBlockPosition() {
        return blockPosition;
    }

    public void setBlockPosition(boolean blockPosition) {
        this.blockPosition = blockPosition;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
}


